package com.springboot.frame.oauth.server.exception;

import com.springboot.frame.oauth.server.utils.ResultCode;
import lombok.Getter;
import lombok.Setter;

/**
 * 自定义异常
 */
@Getter
@Setter
public class Oauth2Exception extends RuntimeException {

    private Integer code;

    private ResultCode resultCode;

    public Oauth2Exception() {
    }

    public Oauth2Exception(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
        this.resultCode = resultCode;
    }


    public Oauth2Exception(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public Oauth2Exception(String message, Throwable cause) {
        super(message, cause);
    }

}
